package service

import (
	"context"

	"algo-sdk-go/project/matchmaking/application/command"
	"algo-sdk-go/project/matchmaking/domain/models/entity"
	"algo-sdk-go/project/matchmaking/domain/port/repo/ops"
	domainService "algo-sdk-go/project/matchmaking/domain/service"
)

type UnverifiedUserProfileService struct {
	matchMakingDomain *domainService.MatchMakingDomain
}

func NewUnverifiedUserProfileService(matchMakingDomain *domainService.MatchMakingDomain) *UnverifiedUserProfileService {
	return &UnverifiedUserProfileService{
		matchMakingDomain: matchMakingDomain,
	}
}

func (m *UnverifiedUserProfileService) AddUnverifiedUserProfile(ctx context.Context, userProfileCmd command.UserProfileCommand) (int, error) {
	return m.matchMakingDomain.SyncUnverifiedUserProfile(ctx, userProfileCmd)
}

func (m *UnverifiedUserProfileService) AppendUnverifiedUserProfile(ctx context.Context, userProfileCmd command.AppendUserprofileCommand) (int, error) {
	return userProfileCmd.UserNum, m.matchMakingDomain.AppendUnverifiedUserProfile(ctx, userProfileCmd)
}

func (m *UnverifiedUserProfileService) GetUnverifiedUserProfile(ctx context.Context, condition ops.Condition) ([]entity.UserProfile, int, error) {
	return m.matchMakingDomain.LoadUnverifiedUserProfile(ctx, condition)
}
